import {createRouter, createWebHistory} from "vue-router";

// 定义一个变量
let router = createRouter({
    // 路由历史
    history: createWebHistory(),
    // 配置路由
    routes: [
        {
            // 路由路径
            path: '/',
            // 路由页面
            component: ()=>import('../view/LoginView.vue')
        },
        {
            // 路由路径
            path: '/dashBoard',
            // 路由页面
            component: ()=>import('../view/DashboardView.vue'),
            // 子路由
            children: [
                // 数据统计
                {
                    path: '',
                    component: ()=>import('../view/StatisticView.vue')
                },
                // 用户管理
                {
                    path: 'user',
                    component: ()=>import('../view/UserView.vue')
                },

                // 用户详情与增加弹窗
                {
                    path: 'user/:id',
                    component: ()=>import('../view/UserDetailView.vue')
                },

                // 市场活动
                {
                    path: 'activity',
                    component: ()=>import('../view/ActivityView.vue')
                },

                // 录入市场活动
                {
                    path: 'activity/add',
                    component: ()=>import('../view/ActivityRecordView.vue')
                },
                {
                    path: 'activity/edit/:id',
                    component: ()=>import('../view/ActivityRecordView.vue')
                },

                // 市场活动详情
                {
                    path: 'activity/:id',
                    component: ()=>import('../view/ActivityDetailView.vue')
                },

                // 线索管理
                {
                    path: 'clue',
                    component: ()=>import('../view/ClueView.vue')
                },

                // 新增线索
                {
                    path: 'clue/add',
                    component: ()=>import('../view/ClueRecordView.vue')
                },

                // 编辑线索
                {
                    path: 'clue/edit/:id',
                    component: ()=>import('../view/ClueRecordView.vue')
                },

                // 线索详情
                {
                    path: 'clue/detail/:id',
                    component: ()=>import('../view/ClueDetailView.vue')
                },

                // 线索详情
                {
                    path: 'customer',
                    component: ()=>import('../view/CustomerView.vue')
                },
            ]
        }
    ]
})
export default router;